/**
 * 定义应用路由
 */
import React from 'react';
import {
  Router,
  // browserHistory,
  hashHistory,
} from 'react-router';

// 路由配置规则参考： https://github.com/ReactTraining/react-router/blob/v3/docs/guides/RouteConfiguration.md#configuration-with-plain-routes
// 一下部分是由 ICE 相关工具自动生成的路由，请勿随意改变，否则可能会出现一些异常情况
// <!-- auto generated routes start -->
import UserDetail from './pages/UserDetail';
import SpecificationEdit from './pages/SpecificationEdit';
import DevicesDetail from './pages/DevicesDetail';
import SpecDetailTotal from './pages/SpecDetailTotal';
import AttributeAdd from './pages/AttributeAdd';
import SpecificationEditField from './pages/SpecificationEditField';
import SpecificationClassify from './pages/SpecificationClassify';
import AddSpecification from './pages/AddSpecification';
import HeaderAsideFooterResponsiveLayout from './layouts/HeaderAsideFooterResponsiveLayout';
import Dashboard from './pages/Dashboard';
import Specification from './pages/Specification';
import SpecificationField from './pages/SpecificationField';
import Devices from './pages/Devices';
import Version from './pages/Version';
import UserList from './pages/UserList';
import NavigationSetting from './pages/NavigationSetting';
import BlankLayout from './layouts/BlankLayout';
import Login from './pages/Login';
import NotFound from './pages/NotFound';
const autoGeneratedRoutes = [ {
  path: 'spec/detail',
  childRoutes: [],
  component: HeaderAsideFooterResponsiveLayout,
  indexRoute: {
    component: SpecDetailTotal
  }
}, {
  path: '/login',
  childRoutes: [],
  component: BlankLayout,
  indexRoute: {
    component: Login
  }
}, {
  path: '/user',
  childRoutes: [{
    path: 'list',
    childRoutes: [],
    component: UserList
  },{
    path: 'detail',
    childRoutes: [],
    indexRoute: {
      component: UserDetail
    }
  },],
  component: HeaderAsideFooterResponsiveLayout,
  indexRoute: {
    component: UserList
  }
}, {
  path: '/version',
  childRoutes: [{
    path: 'list',
    childRoutes: [],
    component: Version
  }],
  component: HeaderAsideFooterResponsiveLayout,
  indexRoute: {
    component: Version
  }
}, {
  path: '/device',
  childRoutes: [{
    path: 'list',
    childRoutes: [],
    component: Devices
  }, {
    path: 'detail',
    indexRoute: {
      component: DevicesDetail
    }
  }],
  component: HeaderAsideFooterResponsiveLayout,
  indexRoute: {
    component: Devices
  }
}, {
  path: '/spec',
  childRoutes: [{
    path: 'list',
    childRoutes: [],
    component: Specification
  }, {
    path: 'field',
    childRoutes: [],
    component: SpecificationField
  }, {
    path: 'add',
    childRoutes: [],
    component: AddSpecification
  }, {
    path: 'edit',
    childRoutes: [],
    indexRoute: {
      component: SpecificationEdit
    }
  }, {
    path: 'classify',
    childRoutes: [],
    indexRoute: {
      component: SpecificationClassify
    }
  }, {
    path: 'editfield',
    childRoutes: [],
    indexRoute: {
      component: SpecificationEditField
    }
  }, {
    path: 'addfield',
    childRoutes: [],
    indexRoute: {
      component: AttributeAdd
    }
  }, {
    path: 'detail',
    childRoutes: [],
    indexRoute: {
      component: SpecDetailTotal
    }
  }],
  component: HeaderAsideFooterResponsiveLayout,
  indexRoute: {
    component: Specification
  }
}, {
  path: '/',
  childRoutes: [{
    path: '*',
    childRoutes: [],
    component: NotFound
  }],
  component: HeaderAsideFooterResponsiveLayout,
  indexRoute: {
    component: Dashboard
  }
}];
// <!-- auto generated routes end -->

// 自定义路由，如果 path 相同则会覆盖自动生成部分的路由配置
const customRoutes = [];

export default (
  <Router
    history={hashHistory}
    routes={[...autoGeneratedRoutes, ...customRoutes]}
  />
);
